package cn.yangliu.constant;

import cn.yangliu.model.IResult;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * the type of serial-port-tool
 *
 * <p>
 * .
 *
 * @author 杨柳
 * @date 2024-05-28
 */
@Getter
@AllArgsConstructor
public enum ResultCode implements IResult {

    SUCCESS("0", "success"),
    SUCCESS_TEMPLATE("0", "%s"),
    ERROR("0001-0001", "system inner error"),
    ERROR_TEMPLATE("0001-0001", "%s"),

    ACCESS_TOKEN_NO_AUTHORITY("9945-19", "access token no authority"),

    /** The access ip no authority. */
    ACCESS_IP_NO_AUTHORITY("9946-10", "access ip no authority"),

    /** The access times excessive. */
    ACCESS_TIMES_EXCESSIVE("9947-11", "access times excessive"),

    /** The insufficient scope. */
    INSUFFICIENT_SCOPE("9948-12", "insufficient scope"),

    /** The access denied. */
    ACCESS_DENIED("9949-13", "access denied"),

    /** The insufficient authentication. */
    INSUFFICIENT_AUTHENTICATION("9950-15",
                                        "insufficient authentication"),

    /** 404. */
    INTERFACE_ADDRESS_NOT_FOUND("9951-16",
                                        "interface address not found"),

    /** The service address not found. */
    SERVICE_ADDRESS_NOT_FOUND("9952-17", "service address not found"),

    /** The interface request timeout. */
    INTERFACE_REQUEST_TIMEOUT("9953-18", "interface request timeout"),

    /** 405. */
    METHOD_NOT_ALLOWED("9954-19", "method not allowed"),

    /** 415. */
    UNSUPPORTED_MEDIA_TYPE("9955-10", "unsupported media type"),

    /** 500. */
    SYSTEM_INNER_ERROR("9956-11", "system inner error"),

    PARAM_IS_INVALID("9903-13", "param is invalid"),

    /** The param is invalid ext. */
    PARAM_IS_INVALID_EXT("9904-14", "param %s is invalid"),

    /** The param is blank. */
    PARAM_IS_BLANK("9905-15", "param is blank"),

    PARAM_TYPE_BIND_ERROR("9907-17", "param type bind error"),

    UNAUTHORIZED("9924-16", "unauthorized"),

    BAD_REQUEST("9901-11", "bad request"),

    ;


    private String code;

    /** The message. */
    private String msg;


}
